﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Defaults.cshtml";
}

<div ng-app="app" ng-controller="DemoCtrl">
    <div class="row-fluid">
        <div class="span6">
            <div id="DataTables_Table_0_length" class="dataTables_length" ng-show="showAdd()">
                <a class="btn btn-info" ng-click="appDialog(false,null)">
                    <i class="glyphicon glyphicon-plus icon-white"></i>
                    Thêm mới
                </a>
            </div>
        </div>
        <div class="span6">
            <div class="control-group">
                <div class="controls">
                    <div class="search">
                        Tìm : <input type="text" ng-model="search.$" />
                    </div>
                </div>
            </div>
        </div>

    </div>

    <table class="table table-striped table-bordered bootstrap-datatable datatable">
        <tr>
            <th>Tên</th>
            <th></th>
        </tr>
        <tr ng-repeat="task in tasks | orderBy : 'tentraiky' | filter:search">

            <td> {{task.tentraiky}}</td>
            <td class="center">
                <div ng-show="showEdit()">
                    <a class="btn btn-info" ng-click="appDialog(true,task)">
                        <i class="icon-edit icon-white"></i>
                        Sửa
                    </a>
                </div>
                <div ng-show="showDelete()">
                    <a class="btn btn-danger" ng-click="delete(task.id)">
                        <i class="icon-trash icon-white"></i>
                        Xóa
                    </a>
                </div>
            </td>

        </tr>
    </table>

    <div ng-controller="DialogCtrl">
        <jqdialog dialog-name="App" title="'tentraiky'"
                  auto-open="false" width="850" height="450"
                  on-open="onOpen" buttons="{'Lưu': onOk, 'Hủy': onCancel, 'Đóng': 'close' }"
                  args-to-scope="true"
                  before-close="beforeClose">
            <form class="form-horizontal">
                <fieldset>
                    <div class="control-group">
                        <label class="control-label" for="tentraiky">Tên : </label>
                        <div class="controls">
                            <input id="tentraiky" ng-model="obj.tentraiky" />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="ghichu">Mô tả :</label>
                        <div class="controls">
                            <textarea class="cleditor" id="ghichu" rows="3"></textarea>
                        </div>
                    </div>
                </fieldset>
            </form>
        </jqdialog>
    </div>
</div>
<script src="~/Content/lib/jquery-1.8.3.js"></script>
<script src="~/Content/lib/jquery-ui.js"></script>
<script src="~/Content/lib/angular.js"></script>
<script src="~/Content/lib/module.js"></script>
<script src="~/Content/js/jqdialog/jqdialog.js"></script>
<script src="~/Content/md/traiky/traiky.js"></script>
<script>
    $("#dscv").html("Danh Sách Trai Kỳ");
</script>

